package fr.afcepf.atod16.groupe1.projet1.dto.catalogue;

import fr.afcepf.atod16.groupe1.projet1.dto.Dto;
import java.util.Date;
import java.util.List;

/**
 * Le DTO produit
 * @author cedric
 */
public class DtoProduit implements Dto {

    private Integer id;
    private String codeEAN13;
    private Date dateCreation;
    private Integer stock;
    private Integer prix;
    private DtoTVA tva;
    private List<DtoFicheProduit> fiches;
    private List<DtoPromo> promos;

    public DtoProduit() {
    }

    public DtoProduit(Integer id, String codeEAN13, Date dateCreation, Integer stock, Integer prix, DtoTVA tva, List<DtoFicheProduit> fiches, List<DtoPromo> promos) {
        this.id = id;
        this.codeEAN13 = codeEAN13;
        this.dateCreation = dateCreation;
        this.stock = stock;
        this.prix = prix;
        this.tva = tva;
        this.fiches = fiches;
        this.promos = promos;
    }

    @Override
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getCodeEAN13() {
        return codeEAN13;
    }

    public void setCodeEAN13(String codeEAN13) {
        this.codeEAN13 = codeEAN13;
    }

    public Date getDateCreation() {
        return dateCreation;
    }

    public void setDateCreation(Date dateCreation) {
        this.dateCreation = dateCreation;
    }

    public Integer getStock() {
        return stock;
    }

    public void setStock(Integer stock) {
        this.stock = stock;
    }

    public Integer getPrix() {
        return prix;
    }

    public void setPrix(Integer prix) {
        this.prix = prix;
    }

    public DtoTVA getTva() {
        return tva;
    }

    public void setTva(DtoTVA tva) {
        this.tva = tva;
    }

    public List<DtoFicheProduit> getFiches() {
        return fiches;
    }

    public void setFiches(List<DtoFicheProduit> fiches) {
        this.fiches = fiches;
    }

    public List<DtoPromo> getPromos() {
        return promos;
    }

    public void setPromos(List<DtoPromo> promos) {
        this.promos = promos;
    }

    @Override
    public String toString() {
        return "DtoProduit{" + "id=" + id + ", codeEAN13=" + codeEAN13 + ", dateCreation=" + dateCreation + ", stock=" + stock + ", prix=" + prix + ", tva=" + tva + '}';
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 53 * hash + (this.id != null ? this.id.hashCode() : 0);
        hash = 53 * hash + (this.codeEAN13 != null ? this.codeEAN13.hashCode() : 0);
        hash = 53 * hash + (this.dateCreation != null ? this.dateCreation.hashCode() : 0);
        hash = 53 * hash + (this.stock != null ? this.stock.hashCode() : 0);
        hash = 53 * hash + (this.prix != null ? this.prix.hashCode() : 0);
        hash = 53 * hash + (this.tva != null ? this.tva.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final DtoProduit other = (DtoProduit) obj;
        if (this.id != other.id && (this.id == null || !this.id.equals(other.id))) {
            return false;
        }
        if ((this.codeEAN13 == null) ? (other.codeEAN13 != null) : !this.codeEAN13.equals(other.codeEAN13)) {
            return false;
        }
        if (this.dateCreation != other.dateCreation && (this.dateCreation == null || !this.dateCreation.equals(other.dateCreation))) {
            return false;
        }
        if (this.stock != other.stock && (this.stock == null || !this.stock.equals(other.stock))) {
            return false;
        }
        if (this.prix != other.prix && (this.prix == null || !this.prix.equals(other.prix))) {
            return false;
        }
        if (this.tva != other.tva && (this.tva == null || !this.tva.equals(other.tva))) {
            return false;
        }
        return true;
    }
}
